﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using BloomsburyBanHang.DAO;

namespace BloomsburyBanHang
{
    public partial class DangKy : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
        {
            FormsAuthentication.SetAuthCookie(CreateUserWizard1.UserName, false /* createPersistentCookie */);
            Roles.AddUserToRole(CreateUserWizard1.UserName, "BasicUser");
            string continueUrl = CreateUserWizard1.ContinueDestinationPageUrl;
            if (String.IsNullOrEmpty(continueUrl))
            {
                continueUrl = "~/";
            }
            string pass = CreateUserWizard1.Password;
            KhachHangDAO.ThemKhachHang(CreateUserWizard1.UserName, CreateUserWizard1.UserName, CreateUserWizard1.Password, "", "");
            Response.Redirect(continueUrl);
        }
    }
}